package com.liuheng.spzx.product.controller;

import com.liuheng.spzx.model.entity.product.Brand;
import com.liuheng.spzx.model.vo.common.Result;
import com.liuheng.spzx.model.vo.common.ResultCodeEnum;
import com.liuheng.spzx.product.mapper.BrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/product/brand/")
public class BrandController {
    @Autowired
    private BrandMapper brandMapper;
    @GetMapping("/findAll")
    public Result findAll(){
        List<Brand> brands = brandMapper.selectList(null);
        return Result.build(brands, ResultCodeEnum.SUCCESS);
    }

}
